home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / update~4.z / update~4 / lib_stdio_puts.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  630 b   |  30 lines

  1. /*                p u t s
  2.  *
  3.  * Write a string followed by a newline character onto stdout. The
  4.  * null character terminating the string is not written.
  5.  *
  6.  * The function returns the last character written (the newline)
  7.  * on success and EOF on error.
  8.  *
  9.  * Patchlevel 1.0
  10.  *
  11.  * Edit History:
  12.  * 03-Sep-1989    Call PUTC() for faster processing of files. Explicit
  13.  *        flush for line buffered streams.
  14.  */
  15.  
  16. #include "stdiolib.h"
  17.  
  18. /*LINTLIBRARY*/
  19.  
  20. int puts(s)
  21.  
  22. CONST char *s;                /* string */
  23.  
  24. {
  25.   return fputs(s, stdout)  == EOF ||
  26.          PUTC('\n',stdout) == EOF ||
  27.      TESTFLAG(stdout, _IOLBF) && fflush(stdout) == EOF
  28.          ? EOF : '\n';
  29. }
  30.